import { IFeidaoAiBrowserComponent, IFeidaoAiNodejsComponent } from '../../interfaces';
import clone from '../obj/clone';

/**
 * 删除url参数
 * @param fd 固定参数
 * @param keys 要删除的键
 * @returns 删除完参数的js对象
 */
export default function del_param(fd: IFeidaoAiBrowserComponent | IFeidaoAiNodejsComponent, ...keys: string[]) {
	const params = fd.data.params;
	const p = clone(params);
	return keys.reduce((pre, cur) => {
		delete pre[cur];
		return pre;
	}, p);
}
